package cn.jasonone.tio.client.test;

import cn.jasonone.tio.tcp.commons.Command;
import cn.jasonone.tio.tcp.handler.CommandHandler;
import org.springframework.stereotype.Component;
import org.tio.core.ChannelContext;

/**
 * @author xujie
 * @version 1.0
 * @date 2022/1/21 8:30
 */
@Component
public class SystemListener implements CommandHandler<String> {
    @Override
    public Command getCommand() {
        return CmdType.SYSTEM_MESSAGE;
    }

    @Override
    public void handler(String data, ChannelContext ctx) throws Exception {
        System.out.println("接收到系统消息:"+data);
    }
}
